python f-string format date

43

python f-string format date -

import datetime
now = datetime.datetime.now()
print(f'{now:%Y-%m-%d %H:%M}')

Comments

Submit
0 Comments